package com.abe.jetpack.base

import android.arch.lifecycle.ViewModelProvider
import com.abe.jetpack.inject.component.AppComponent
import com.abe.jetpack.inject.component.DaggerAppComponent
import com.abe.jetpack.inject.module.AppModule
import com.abe.libcore.AbeApplication
import javax.inject.Inject

class ManagerAPP : AbeApplication() {

    companion object {
        private var appComponent: AppComponent? = null

        fun appComponent(): AppComponent {
            return appComponent!!
        }
    }

    @Inject
    lateinit var factory: ViewModelProvider.Factory

    override fun onCreate() {
        super.onCreate()
        appComponent = DaggerAppComponent.builder().appModule(AppModule(this)).build()
        appComponent!!.inject(this)
    }

}